package com.canton.dao.repository;

import com.canton.dao.entity.GrapeNode;
import com.canton.dao.entity.ImageNode;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

@Repository
public interface GrapeRepository extends Neo4jRepository <GrapeNode,Long> {


    GrapeNode findByName(@Param("name") String name);

    //模糊查询
    @Query("match (n:品种名) where n.名称 =~ ('.*'+$likes+'.*') return n")
    List<GrapeNode> findByNameLike(@Param("likes") String likes);
    //查询所有节点
    List<GrapeNode> findAll();




}

